package com.yzh.wanandroid.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.yzh.wanandroid.component.activity.MainActivity
import com.yzh.wanandroid.component.fragment.*
import com.yzh.wanandroid.utils.*

class MainPagerAdapter(activity: MainActivity): FragmentStateAdapter(activity) {
    override fun getItemCount() = 3

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            PAGER_HOME -> HomePagerFragment.getInstance()
            PAGER_SQUARE -> SquarePagerFragment.getInstance()
            PAGER_PUBLIC -> PublicPagerFragment.getInstance()
            PAGER_PROJECT -> ProjectPagerFragment.getInstance()
//            PAGER_MINE -> MinePagerFragment.getInstance()
            else -> HomePagerFragment.getInstance()
        }
    }
}